package services

import (
	"weiboxs.com/new_h_glasses/models"
)

func ArchivesInsert(m *models.Archives, opt *models.Optometry) error {

	if _, err := models.ArchivesAdd(m); err != nil {
		return err
	}

	opt.Id = 0
	opt.Archives = m
	if _, err := models.OptometryAdd(opt); err != nil {
		return err
	}

	return nil
}

func ArchivesUpdate(m *models.Archives, opt *models.Optometry) error {

	if err := m.ArchivesEdit(); err != nil {
		return err
	}

	return nil
}
